home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 November: Tool Chest / Dev.CD Nov 98 TC.toast / Sample Code / Snippets / Development Tools & Languages / DTSCPlusLibrary / Sources / UserTerminationTest.cp < prev    next >
Encoding:
Text File  |  1993-01-14  |  1.3 KB  |  40 lines  |  [TEXT/MPS ]

  1. /* _________________________________________________________________________________________________________ //
  2.   Copyright © 1992 Apple Computer, Inc. All rights reserved.
  3.   Macintosh Developer Technical Support.C++ Macintosh Toolbox Framework.
  4.   Programmer: Kent Sandvik
  5.   Date: 9/26/92
  6.   Revision comments are at the end of this file.
  7.   ---
  8.   TUserTermination is a command dot tracking class, used for finding out if the end user wants to stop
  9.   an action. Most of the code is based on earlier snippet by Dave Radcliffe/DTS.
  10.   TUserTerminationTest .cp contains the class testing functions.
  11.   _________________________________________________________________________________________________________ */
  12.  
  13. #include "UserTermination.h"
  14.  
  15. // This test will create one TUserTermination class on the stack, and abort when the
  16. // user hits "command-.".
  17.  
  18. void main(void)
  19. {
  20.     cout << "Start of TUserTermination test…\n";
  21.  
  22.     TUserTermination myTerminator;
  23.  
  24.     // run a loop, terminate when command-dot is pressed
  25.     Boolean pressed = false;
  26.     while (!pressed)
  27.     {
  28.         pressed = myTerminator.Abort();
  29.     }
  30.  
  31.     cout << "End of TUserTermination test…\n";
  32. }
  33.  
  34. // _________________________________________________________________________________________________________ //
  35.  
  36. /*    Change History (most recent last):
  37.   No        Init.    Date        Comment
  38.   1            khs        9/26/92        New file
  39. */
  40.